import logging
import logging.config
import os


class LogHelper:
    def __init__(self):
        logging.config.fileConfig(r"./logging.ini")
        self.debug_logger = logging.getLogger("debug")
        self.info_logger = logging.getLogger("info")
        self.error_logger = logging.getLogger("error")

    def debug(self, message):
        self.debug_logger.debug(message)

    def info(self, message):
        self.info_logger.info(message)

    def error(self, message):
        self.error_logger.error(message)

    def custom_log(self, content, path_file_name):
        if not os.path.exists(path_file_name):
            f = open(path_file_name, "w")
            f.close()

        f = open(path_file_name, "a")
        f.write(content)


if __name__ == '__main__':
    log_helper = LogHelper()
    log_helper.debug("debug")
    log_helper.info("info")
    log_helper.info("info")
    log_helper.error('errorsssss')
